package com.yc.demo.filter;

import org.springframework.web.filter.OncePerRequestFilter;

import java.io.*;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p></p>
 *
 * @author: YuanChilde
 * @date: 2020-02-13 15:59
 * @version: 1.0
 * Modification History:
 * Date    Author      Version     Description
 * -----------------------------------------------------------------
 * 2020-02-13 15:59    YuanChilde     1.0        新增
 */
// 在主程序需加上@ServletComponentScan注解
@WebFilter(filterName = "hello2Filter", urlPatterns = {"/app/api/*"})
public class Hello2Filter extends OncePerRequestFilter {
    @Override
    protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
        filterChain.doFilter(httpServletRequest, httpServletResponse);
    }
}
